﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pata.SylkSharp.Core.Bll
{
    /// <summary>
    /// Enumerates the possible fields in a <see cref="ERecord"/>
    /// </summary>
    public enum ERecordFieldType
    {
        Unknown = 100
    }

    /// <summary>
    /// Object representation of field of a Sylk record of type 'E'
    /// </summary>
    public class ERecordField : FieldBase<ERecordFieldType>
    {
        /// <summary>
        /// Instanciate a new <see cref="ERecordField"/>
        /// </summary>
        public ERecordField()
            : base(ERecordFieldType.Unknown, String.Empty) { }

        /// <summary>
        /// Instanciate a new <see cref="ERecordField"/>
        /// </summary>
        /// <param name="pType">Type of this field.</param>
        /// <param name="pValue">The value contained by this field.</param>
        public ERecordField(ERecordFieldType pType, string pValue)
            : base(pType, pValue) { }
    }

    /// <summary>
    /// Object representation of a Sylk record of type 'E'.
    /// End of file.
    /// Must be last record.
    /// </summary>
    public class ERecord : RecordBase<ERecordField, ERecordFieldType>
    {
        //TODO:Complete this array.
        private static readonly ERecordFieldType[] _MANDATORY_FIELDS = new ERecordFieldType[] { };

        /// <summary>
        /// Instanciate a new <see cref="ERecord"/>
        /// </summary>
        public ERecord(string pLineWithoutId)
            : base(RecordType.E, pLineWithoutId, ERecordFieldType.Unknown) { }

        /// <summary>
        /// Get mandatory fields for this record.
        /// </summary>
        /// <returns></returns>
        public override System.Collections.Generic.IEnumerable<ERecordFieldType> GetMandatoryFields()
        {
            return _MANDATORY_FIELDS;
        }

        /// <summary>
        /// Get the default field type.
        /// </summary>
        /// <returns></returns>
        public override ERecordFieldType GetUnknownFieldType()
        {
            return ERecordFieldType.Unknown;
        }
    }
}
